package com.zmx.advice;

import com.zmx.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 2020/10/19
 * 19:28
 * zmx
 */
@RestControllerAdvice
public class MyControllerAdvice {
    @ExceptionHandler(Exception.class)
    public R handlerException(Exception e){
        return R.fail(e.getMessage()).add("user","chichi");
    }
}
